
const usePageInfoStore = defineStore('pageInfo', {
	state: () => ({
		paperName: '',
		timu: '',
		radioList: [],
		determineList: [],
		multipleList: [],
		blanksList: [],
		startTime: '',
		testDuration: '',
		lastTime: 10000
	}),
	actions: {
		// 存入题目信息
		setInfo(pageInfo) {
			this.paperName = pageInfo.paperName
			this.radioList = pageInfo.radioList
			this.determineList = pageInfo.determineList
			this.multipleList = pageInfo.multipleList
			this.blanksList = pageInfo.blanksList
			this.timu = pageInfo.timu
			this.startTime = new Date(pageInfo.startTime)
			this.testDuration = pageInfo.testDuration
			this.lastTime = pageInfo.testDuration*60-Math.floor((Date.now() - this.startTime)/1000)
		}
	}
})

export default usePageInfoStore
